/*
Copyright (c) [2019年5月1日] [吴超]
[MBT_studio] is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/
#pragma once

#include "底层绘图/intern/Vulkan/Vulkan框架.h"
#include "底层绘图/intern/Vulkan/线管/着色器.h"




struct S_Vk线管 : public S_线管 {
	VkDevice		m_设备;
	VkRenderPass	m_渲染通道;

	VkPipelineCache m_线管缓存;
	VkPipeline		m_线管;
	
	S_Vk线管(S_设备环境& 环境, std::string name);
	~S_Vk线管();

	void f_创建线管(const S_线管创建参数& 参数, S_着色& shader);

};






struct S_Vk计算线管 : public S_线管 {
	VkDevice		m_设备;

	VkPipelineCache m_线管缓存;
	VkPipeline		m_线管;

	S_Vk计算线管(S_设备环境& 环境, std::string name);
	~S_Vk计算线管();

	void f_创建线管(const S_线管创建参数& 参数, S_着色& shader);

};







struct S_Vk光追线管 : public S_线管 {
	VkPipeline		m_线管;
	S_Vk着色*		m_着色;
	VkPipelineLayout	m_线管布局;

	std::vector<VkDescriptorSetLayout>		m_参数布局;

	S_Vk光追线管(S_设备环境& ctx, std::string name);

	void f_创建线管(const S_线管创建参数& 参数, S_着色& shader) {}
	void f_创建线管(const S_线管创建配置& 参数, S_着色& shader);
	void f_重置线管();
	void f_销毁线管();

	//void f_添加着色器(const std::string path, int32 loc);
	void f_销毁着色器(uint32 id);
};




VkPipeline f_pipeline_创建(S_Vk着色* 着色, VkPipelineLayout 线管布局, S_设备环境& ctx);

